home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13309 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: host1.einstein.com.ar!news
  2. From: jkohen@einstein.com.ar (Javier Kohen)
  3. Newsgroups: comp.lang.c
  4. Subject: Help me with a bug programming the mouse
  5. Date: Sat, 06 Apr 1996 00:08:55 GMT
  6. Organization: Red Einstein
  7. Message-ID: <4k4i5f$nn7@host1.einstein.com.ar>
  8. Reply-To: jkohen@einstein.com.ar
  9. NNTP-Posting-Host: ppp-09.einstein.com.ar
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. I have a problem with the mouse in 80x86 assembler.
  13.  
  14. I am working on 486/66, Microsoft Mouse Driver 9.0 and a Microsoft
  15. InPort
  16. Mouse connected on a PS/2 mouse port. The code below doesn't work
  17. right (it
  18. is a fragment, the original compiles right). When I press the button
  19. once, the
  20. program ends, because the effect of the first time I pressed the
  21. button remains
  22. in the second loop. I try puting a delay before the second
  23. interruption call,
  24. but it doesn't affect the problem, even with a 200 miliseconds delay
  25. (too much
  26. to wait for in a program). Where the hell is the bug? Should I use
  27. another
  28. mouse function?.
  29.  
  30. Sorry but my english isn't very good.
  31.  
  32. Here is the problematic code:
  33.  
  34. ;;;;; CUT HERE
  35.  
  36.     mov    ax, 03        ; call mouse function number 3.
  37. Loop1:
  38.  
  39.     int    33        ; get position and button status. (First call)
  40.     test    bx, 07        ; test for any button press.
  41.     jz    Loop1        ; if no button is pressed loop again.
  42.  
  43. Loop2:
  44.     int    33        ; get position and button status. (Second call)
  45.     test    bx, 07        ; test for any button press.
  46.     jz    Loop2        ; if no button is pressed loop again.
  47.  
  48. ;;;;; CUT HERE
  49.  
  50. Thanks,
  51. Javier Kohen
  52.  
  53. Please E-mailme a fix to jkohen@einstein.com.ar
  54.  
  55.  
  56.